package com.ultrapower.bean;

import java.util.ArrayList;
import java.util.List;

import com.ultrapower.buffer.Buffer;
import com.ultrapower.buffer.FixedBuffer;

public class ServiceInfoBean {
	private final String serviceName;
	private final List<String> serviceLibs;

	public ServiceInfoBean(final byte[] value) {
		final Buffer buffer = new FixedBuffer(value);
		this.serviceName = buffer.read2PrefixedString();
		final int numServiceLibs = buffer.readVInt();
		this.serviceLibs = new ArrayList<String>(numServiceLibs);
		for (int i = 0; i < numServiceLibs; i++) {
			this.serviceLibs.add(buffer.read2PrefixedString());
		}
	}

	@Override
	public String toString() {
		return "ServiceInfoBean [serviceName=" + serviceName + ", serviceLibs=" + serviceLibs + "]";
	}
	
}
